package com.apitest.moudle;


import java.util.ArrayList;
import java.util.List;

/**
 * @program: APITest
 * @description: case com.apitest.moudle
 * @author: shixing
 * @create: 2021-05-05 09:13
 **/
public class CaseDesign {
    private String name;
    private List<String> valid;
    private List<String> inValid;
    private List<String> parmasAll;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getValid() {
        return valid;
    }

    public void setValid(List<String> valid) {
        this.valid = valid;
    }

    public List<String> getInValid() {
        return inValid;
    }

    public void setInValid(List<String> inValid) {
        this.inValid = inValid;
    }

    public List<String> getParmasAll() {
        if(this.parmasAll == null){
            parmasAll = new ArrayList<>();
            parmasAll.addAll(this.valid);
            parmasAll.addAll(this.inValid);
        }
        return parmasAll;
    }

    public List<Attributes> getAttributsParmasAll(){
        List<Attributes> valids = new ArrayList<>();
        List<Attributes> inVaids = new ArrayList<>();
        if(this.valid!=null){
            this.valid.forEach( val ->{
                valids.add(new Attributes(this.name,val,true));
            });
        }
        if(this.inValid != null){
            this.inValid.forEach( val ->{
                inVaids.add(new Attributes(this.name,val,false));
            });
        }
        valids.addAll(inVaids);
        return  valids;
    }
}
